<meta title="更新角色" width="600px" args="role"/>
<form role="form" id="roleForm" s="valid,form,datac,nda"
      class="form-horizontal"
      method="put"
      s-form="{done:submitDone}"
      s-data="role"
      style="padding: 20px;" action="/api/role/{role.id}">
    <div class="form-group" s-valid-role="item">
        <label class="col-sm-2 control-label">名称：</label>
        <div class="col-sm-10">
            <input type="text" name="name" class="form-control" placeholder="名称" s-valid-error="require()">
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">状态：</label>
        <div class="col-sm-10">
            <label class="radio-inline">
                <input type="radio" name="valid" checked value="true"> 正常
            </label>
            <label class="radio-inline">
                <input type="radio" name="valid" value="false"> 冻结
            </label>
        </div>
    </div>
</form>
<script type="text/javascript">
    S.meta.btns = [
        {
            name: "保存",
            style: "btn btn-primary",
            click: function(){
                return S.S("#roleForm").submit()
            }
        },
        {
            name: "关闭",
            style: "btn btn-default",
            click: function(){
                S.close();
            }
        }
    ]

    function submitDone(rs){
        S.close(rs);
    }
</script>